import request from '@/utils/request'

export default {


  /**
   *   传角色ID,得到角色信息
   * @param id
   * @private
   */
  __api__getRole:(id)=>{
    return request({
      url:'/roles/'+id,
      method:'get'
    })
  },

  __api__getRolesAll:()=>{
    return request({
      url:'/roles/all',
      method:'get'
    })
  },


  /**
   *   分页获取角色列表
   * @param roleQueryInfo
   * @private
   */
  __api__getRoles:(roleQueryInfo)=>{

    return request({
      url:'/roles',
      params:roleQueryInfo,
      method:'get'
    })
  },


  /**
   *  全量修改角色信息
   * @param role
   * @private
   */
  __api__updateRole:(role)=>{
    return request({
      url:'/roles',
      data: role,
      method:'put'
    })
  },

  /**
   *  传入角色ID,删除角色
   * @param id
   * @private
   */
  __api__deleteRole:(ids)=>{
    let idsString = ids.join(',');
    return request({
      url:'/roles/'+idsString,
      method:'delete'
    })
  },

  /**
   *   添加一个角色
    * @param role
   * @private
   */
  __api__addRole:(role)=>{
    return request({
      url:'/roles',
      method:'post',
      data:role
    })
  }



}
